<!-- 深层代码传递 -->

<script setup lang="ts">
import { defineAsyncComponent, provide, ref } from "vue";

const injectProvideL1Page = defineAsyncComponent(
  () => import("../components/injectProvide/level1.vue")
);

const dynamicCount = ref(0);
provide("dynamicCount", dynamicCount);
</script>

 
<template>
  <div class="index-wrap">
    <!-- <h1>一级组件：Props传递</h1>
    <injectProvideL1Page msg="通过Props嵌套传递" />
    <hr /> -->
    <h1>一级组件：Provide传递</h1>
    <el-button type="primary" @click="dynamicCount++">dynamicCount Add</el-button>
    <injectProvideL1Page />
  </div>
</template>
<style>
.index-wrap {
  margin: 200px auto;
  width: 500px;
}
</style>
